<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
	<body>
		<c:forEach items="${tables}" var="t">
			<c:choose>
				<c:when test="${not empty t.getGuests()}">
					<h3>Table #${t.getId()}</h3>
					<table border="1">
						<tr><th>ID</th><th>Name</th><th>Age</th><th>Valid</th></tr>
						<c:forEach items="${t.getGuests()}" var="g">
						<tr><th>${g.getId()}</th><th>${g.getName()}</th><th>${g.getAge()}</th><th>${not t.containsGuests(g.getDislikes())}</th></tr>
						</c:forEach>
					</table>
				</c:when>
				<c:otherwise>
					<h3>Table #${t.getId()} is empty</h3>
				</c:otherwise>
			</c:choose>
		</c:forEach>
	</body>
</html>
